"""
26ms 3176KB 50Min
3 20
18 15 10
75 72 45
"""
n,d=map(int,input().split())

# invent,price=[False*n],[False*n]
invent=[float(i) for i in input().split()]
price=[float(i) for i in input().split()]

uprice={i:price[i]/invent[i] for i in range(n)}
# uprice={price[i]/invent[i]:(price[i],invent[i]) for i in range(n)} #这种方法导致了一个错误

order=sorted(uprice,key=lambda i:uprice[i],reverse=True)

ans=0
for i in order:
    if invent[i]>d:
        ans+=uprice[i]*d
        break
    else:
        d-=invent[i]
        ans+=price[i]

print("{:.2f}".format(ans))
